//
//  UIView+Frame.m
//  01-UIView、UIWindow
//
//  Created by dllo on 16/7/14.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

- (void)setDk_centerX:(CGFloat)dk_centerX {
    CGPoint center = self.center;
    center.x = dk_centerX;
    self.center = center;
}

- (void)setDk_centerY:(CGFloat)dk_centerY {
    CGPoint center = self.center;
    center.y = dk_centerY;
    self.center = center;
}

- (CGFloat)dk_centerX {
    return self.center.x;
}

- (CGFloat)dk_centerY {
    return self.center.y;
}


- (void)setDk_x:(CGFloat)dk_x {
    CGRect rect = self.frame;
    rect.origin.x = dk_x;
    self.frame = rect;
}

- (CGFloat)dk_x {
    return self.frame.origin.x;
}

- (void)setDk_y:(CGFloat)dk_y {
    CGRect rect = self.frame;
    rect.origin.y = dk_y;
    self.frame = rect;
}

- (CGFloat)dk_y {
    return self.frame.origin.y;
}

- (void)setDk_height:(CGFloat)dk_height {
    CGRect rect = self.frame;
    rect.size.height = dk_height;
    self.frame = rect;
}

- (CGFloat)dk_height {
    return self.frame.size.height;
}

- (void)setDk_width:(CGFloat)dk_width {
    CGRect rect = self.frame;
    rect.size.width = dk_width;
    self.frame = rect;
}

- (CGFloat)dk_width {
    return self.frame.size.width;
}
@end
